﻿package com.tudou.home.common.button
{
    import com.tudou.home.common.events.*;
    import flash.display.*;
    import flash.events.*;
    import flash.utils.*;

    public class AutoPrevNextButton extends PrevNextButton
    {
        protected var timer:Timer;

        public function AutoPrevNextButton(param1:InteractiveObject, param2:InteractiveObject, param3:InteractiveObject, param4:InteractiveObject)
        {
            super(param1, param2, param3, param4);
            timer = new Timer(10000);
            timer.addEventListener(TimerEvent.TIMER, timerHlr);
            return;
        }// end function

        public function setDelay(param1:Number) : void
        {
            timer.delay = param1;
            return;
        }// end function

        public function start() : void
        {
            timer.reset();
            timer.start();
            return;
        }// end function

        public function stop() : void
        {
            timer.stop();
            return;
        }// end function

        protected function timerHlr(event:TimerEvent) : void
        {
            dispatchEvent(new PrevNextEvent(PrevNextEvent.NEXT, index));
            return;
        }// end function

    }
}
